From 244f052432bf298aab625e48001b9715e98afcdd Mon Sep 17 00:00:00 2001 From: David Dias Date: Tue, 28 Jun 2016 10:24:05 +0100 Subject: [PATCH 1/3] init name API --- API/name/README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 API/name/README.md diff --git a/API/name/README.md b/API/name/README.md new file mode 100644 index 000000000..8c8bd3399 --- /dev/null +++ b/API/name/README.md @@ -0,0 +1,4 @@ +name API +======== + + From 781ac2fb938d88a5cab3d3d2dbaafa4dc34d08e3 Mon Sep 17 00:00:00 2001 From: David Dias Date: Mon, 8 Aug 2016 16:24:46 +0100 Subject: [PATCH 2/3] feat(name): add name.publish spec --- API/name/README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/API/name/README.md b/API/name/README.md index 8c8bd3399..776f9baf2 100644 --- a/API/name/README.md +++ b/API/name/README.md @@ -1,4 +1,56 @@ name API ======== +#### `publish` + +> Publish an IPNS name with a given value. + +##### `Go` **WIP** + +##### `JavaScript` - ipfs.name.publish(value, [options, callback]) + +`value` is a base58 encoded IPFS multihash, such as: `/ipfs/QmbezGequPwcsWo8UL4wDF6a8hYwM1hmbzYv2mnKkEWaUp`. + +`options` is an object that may contain: + +```JavaScript +{ + resolve: // bool - Resolve given path before publishing. Default: true. + lifetime: // string - Time duration of the record. Defaulg: 24h + ttl: // string - Time duration this record should be cached +} +``` + +`callback` must follow `function (err, name) {}` signature, where `err` is an error if the operation was not successful. `name` is an object that contains the IPNS hash and the IPFS hash publishes, such as: + +```JavaScript +{ + name: "/ipns/QmHash.." + value: "/ipfs/QmHash.." +} +``` + +If no `callback` is passed, a promise is returned. + +Example: + +```JavaScript +// TODO +``` + +#### `resolve` + +> Resolve an IPNS name. + +##### `Go` **WIP** + +##### `JavaScript` - ipfs.name.resolve(value, [options, callback]) + +If no `callback` is passed, a promise is returned. + +-r, --recursive bool - Resolve until the result is not an IPNS name. Default: false. +-n, --nocache bool - Do not use cached entries. Default: false. + +Example: + From 750dfeae87e58e63023f14ad4999b491fb9766b7 Mon Sep 17 00:00:00 2001 From: David Dias Date: Mon, 8 Aug 2016 16:30:10 +0100 Subject: [PATCH 3/3] feat(name): add name.resolve spec --- API/name/README.md | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/API/name/README.md b/API/name/README.md index 776f9baf2..6a461f37f 100644 --- a/API/name/README.md +++ b/API/name/README.md @@ -21,7 +21,7 @@ name API } ``` -`callback` must follow `function (err, name) {}` signature, where `err` is an error if the operation was not successful. `name` is an object that contains the IPNS hash and the IPFS hash publishes, such as: +`callback` must follow `function (err, name) {}` signature, where `err` is an error if the operation was not successful. `name` is an object that contains the IPNS hash and the IPFS hash, such as: ```JavaScript { @@ -44,13 +44,30 @@ Example: ##### `Go` **WIP** -##### `JavaScript` - ipfs.name.resolve(value, [options, callback]) +##### `JavaScript` - ipfs.name.resolve([options, callback]) -If no `callback` is passed, a promise is returned. +`options` is an object that may contain: + +```JavaScript +{ + recursive: // bool - Resolve until the result is not an IPNS name. Default: false. + nocache: // bool - Do not use cached entries. Default: false. +} +``` --r, --recursive bool - Resolve until the result is not an IPNS name. Default: false. --n, --nocache bool - Do not use cached entries. Default: false. +`callback` must follow `function (err, name) {}` signature, where `err` is an error if the operation was not successful. `name` is an object that contains the IPNS hash and the IPFS hash, such as: -Example: +```JavaScript +{ + name: "/ipns/QmHash.." + value: "/ipfs/QmHash.." +} +``` + +If no `callback` is passed, a promise is returned. +Example: +```JavaScript +// TODO +```