drone config and doc generation

This commit is contained in:
nitowa
2022-02-01 17:16:31 +01:00
parent 6540060942
commit 898cad5f55
4 changed files with 96 additions and 4 deletions
+10 -2
View File
@@ -5,7 +5,7 @@
[![Weekly Downloads](https://img.shields.io/npm/dw/xrpio?color=important)](https://www.npmjs.com/package/xrpio)
[![License Type](https://img.shields.io/npm/l/xrpio?color=blueviolet)](https://gitea.nitowa.xyz/docs/xrpio/src/branch/master/LICENSE.md)
xrpio is a library that allows you to write and read arbitrary data to the ripple blockchain.
xrpio is a library that allows you to write and read arbitrary data in the ripple blockchain.
# How to install
```
@@ -19,7 +19,15 @@ import {treeRead, treeWrite} from 'xrpio'
const api = new RippleAPI({ server: "..." })
await api.connect()
const dataRootHash = await treeWrite(api, "Arbitrary string data 123", {address: "Sender address", secret: "Sender private key"}, "Receiver address")
const dataRootHash = await treeWrite(
api,
"Arbitrary string data 123",
{
address: "Sender address",
secret: "Sender private key"
},
"Receiver address"
)
const data = await treeRead(api, [dataRootHash])
console.log(data) //"Arbitrary string data 123"
+83
View File
@@ -0,0 +1,83 @@
---
kind: pipeline
type: docker
name: default
steps:
- name: restore cache
image: drillster/drone-volume-cache
settings:
restore: true
mount:
- ./node_modules
volumes:
- name: cache
path: /cache
- name: npm install
image: node:12
commands:
- npm install
- name: npm run build
image: node:12
commands:
- npm run build
- name: rebuild cache
image: drillster/drone-volume-cache
settings:
rebuild: true
mount:
- ./node_modules
volumes:
- name: cache
path: /cache
- name: npm run test
image: node:12
commands:
- npm run test
- name: build docs
image: node:12
commands:
- npm run docs
when:
event:
- tag
- name: deliver docs
image: node:12
commands:
- echo ${DRONE_BUILD_CREATED}
- git clone https://gitea.nitowa.xyz/docs/${DRONE_REPO_NAME}.git; cd ${DRONE_REPO_NAME} && rm -rf ./*; cp -r ../docs/* .; cp ../LICENSE.md .
- sed -i '1,3d; $d' README.md && echo "### Version\n\n${DRONE_TAG}\n" >> ./README.md
- sed -i -e 1,4d ./globals.md && cat ./globals.md >> ./README.md
- git add --all; git -c user.email="${DRONE_COMMIT_AUTHOR_EMAIL}" -c user.name="${DRONE_COMMIT_AUTHOR}" commit --all --allow-empty --message "generated from tag ${DRONE_TAG}"
- (git tag ${DRONE_TAG} && git push --force origin master ${DRONE_TAG}) || true
environment:
GIT_USER:
from_secret: git_user
GIT_PASSWORD:
from_secret: git_password
when:
event:
- tag
- name: npm publish
image: plugins/npm
settings:
username: nitowa
password:
from_secret: npm_password
email: peter.millauer@gmail.com
when:
event:
- tag
volumes:
- name: cache
host:
path: /tmp
+2 -1
View File
@@ -13,7 +13,8 @@
"webpack-gui": "webpack --config webpack.gui.js --progress && cp build/gui/main.js gui",
"webpack-gateway": "webpack --config webpack.gateway.js --progress && cp build/gateway/main.js gateway",
"test": "npm run build && mocha --bail=true ./lib/test/*.js",
"deploy": "node ./lib/Deploy.js"
"deploy": "node ./lib/Deploy.js",
"docs": "typedoc --out docs ./src --readme ./README.md --plugin typedoc-plugin-markdown --mode file --hideBreadcrumbs --hideSources"
},
"author": "nitowa",
"license": "MIT",
+1 -1
View File
@@ -60,7 +60,7 @@ describe('XRPIO', () => {
let treeRoot
it(`can tree write (${TEST_DATA.length} bytes)`, async function (){
this.timeout(10000)
treeRoot = await treeWrite(api, TEST_DATA, sendWallet, receiveWallet.address)
treeRoot = await treeWrite(api, TEST_DATA, {address: "123", secret: "123"}, receiveWallet.address)
})
it('can tree read', async function() {