a Bridge between IPFS and ARWEAVE
A bridge to connect IPFS to Arweave https://www.arweave.org/
Click on the image to enlarge it
Tested on ubuntu 19.04
example: /api/transfer
output:
{
"duration": "1.145424997s",
"id": "Qq2IE63kxOaZp7laJapQqyu1PUPPktGoSSyKTLI9iP4",
"payload_bytes": 14
}
POST a raw json body containing
{
“ipfs_hash”: “THE_IPFS_HASH”,
“use_compression”: BOOLEAN,
“tags”: [
{
“key”: “key1”,
“value”: “value1”
},…
]
}
Where:
example:
{
"ipfs_hash": "Qmc5gCcjYypU7y28oCALwfSvxCBskLuPKWpK4qpterKC7z",
"use_compression": false,
"tags": [
{
"key": "key1",
"value": "value1"
},
{
"key": "key2",
"value": "value2"
}
]
}
response:
(it’s up to the user how often they pool for the transaction status)
Response:
{
"duration": "1.145424997s",
"id": "Qq2IE63kxOaZp7laJapQqyu1PUPPktGoSSyKTLI9iP4",
"payload_bytes": 14
}
checkout the Dockerfile
docker build -t iab:1.0 .
docker run -p 5555:5555 iab:1.0
if you want to build it you need go >= 1.12
in the root directory run:
go build -o YOUR_BINARY_NAME
./YOUR_BINARY_NAME
for installing go check: https://golang.org/doc/install
it should build & run without problems on macOS & Windows
{
"debug": true,
"nodeURL": "https://arweave.net",
"ipfsGateway": "https://ipfs.infura.io/ipfs/",
"walletFile": "/path_to_your_wallet/arweave-wallet.json",
"cleanup": true,
"server": {
"host": "0.0.0.0",
"port": 5555
}
}
Where:
about IPFS gateway:
choices:
What if you want to host your own gateway ?
make sure you crete an api that will just accept a ipfs hash after the “/“
used to check if the service is alive
output:
pong
returns your balance of AR Tokens
output:
{
"ar": "0.9996836928",
"winston": "999683692828"
}
example: /api/check_tx_arweave?transaction_id=bnRQhVkook_lPv8uxuDRcj-wC5R2nfVps-2qA6-81WU
output:
the transaction details or it's status (ex: pending)
example: /api/ipfs?hash=QmbRmU9vYwH9Hhn1eH1WEFVS9sugpGSdJrfqtuZ329EgZA
output:
content of the file from IPFS
example: /api/arweave?transaction_id=GyrTvuUBK9AgVLGBA8SsOHkUYmWApNqvJtMjJZZIvbQ&decode=BOOLEAN&extract=true
output:
content of the file from Arweave
Where:
with:
{
"payload": "CXR4SUQsIHBheWxvYWRMZW4sIGVyciA6PSBhcndlYXZlLlRyYW5zZmVyRGlyZWN0bHlBcndlYXZlKG5UcmFuc2Zlci5QYXlsb2FkLCBhclRhZ3MsIGNvbmZpZ3VyYXRpb24pCglpZiBlcnIgIT0gbmlsIHsKCQljLkpTT04oaHR0cC5TdGF0dXNCYWRSZXF1ZXN0LCBnaW4uSHsiZXJyb3IiOiBlcnIuRXJyb3IoKX0pCgkJcmV0dXJuCgl9CgoJbG9nLlByaW50ZigiVHJhbnNmZXIgdG8gQXJ3ZWF2ZSBmaW5pc2hlZCBzdWNjZXNzZnVsbHkuIFR4IElEICVzIiwgdHhJRCkKCgljLkpTT04oaHR0cC5TdGF0dXNPSywgZ2luLkh7ImlkIjogdHhJRCwgInBheWxvYWRfYnl0ZXMiOiBwYXlsb2FkTGVuLCAiZHVyYXRpb24iOiBmbXQuU3ByaW50ZigiJXMiLCB0aW1lLlNpbmNlKHN0YXJ0KSl9KQ==",
"tags": [
{
"key": "key1",
"value": "value1"
},
{
"key2": "value2"
}
]
}
Where:
https://github.com/Dev43/arweave-go -> for the transaction signing & sending code
fell free to create an issue
This project has a few principle-based goals that guide its development:
Limit dependencies. Keep the package lightweight.
Pure Go. This means no cgo or other external/system dependencies. This package should be able to stand on its own and cross-compile easily to any platform — and that includes its library dependencies.
Idiomatic Go. Keep interfaces small, variable names semantic, vet shows no errors, the linter (golangci lint) is generally quiet, etc.
Well-documented. Use comments prudently; explain why non-obvious code is necessary (and use tests to enforce it). Keep the docs updated, and have examples where helpful.
Keep it efficient. This often means keep it simple. Fast code is valuable.
Consensus. Contributions should ideally be approved by multiple reviewers before being merged. Generally, avoid merging multi-chunk changes that do not go through at least one or two iterations/reviews. Except for trivial changes, PRs are seldom ready to merge right away.
Have fun contributing. Coding is awesome!
I welcome contributions and appreciate your efforts! However, please open issues to discuss any changes before spending the time preparing a pull request.
This will save time, reduce frustration, and help coordinate the work. Thank you!
IPFS Arweave Bridge is released under the MIT license.