Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #803 from EOSIO/kv_tables
Browse files Browse the repository at this point in the history
Code to support KV Tables
  • Loading branch information
Brad Hart committed Sep 29, 2020
2 parents 08dc543 + 8018c4b commit c73b44d
Show file tree
Hide file tree
Showing 13 changed files with 468 additions and 313 deletions.
44 changes: 27 additions & 17 deletions .github/eosjs-ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
### Current Version: v0.2.3
### Current Version: v0.2.5
### Test:
#### docker build --tag eosjs-ci:test ./.github/eosjs-ci
#### docker run --publish 8888:8888 eosjs-ci:test
### Deploy:
#### docker build --tag eosio/eosjs-ci:v0.2.3 ./.github/eosjs-ci
#### docker push eosio/eosjs-ci:v0.2.3
#### docker build --tag eosio/eosjs-ci:v0.2.5 ./.github/eosjs-ci
#### docker push eosio/eosjs-ci:v0.2.5

FROM ubuntu:18.04
ENTRYPOINT ["nodeos", "--data-dir", "/root/.local/share", "-e", "-p", "eosio", "--replay-blockchain", "--plugin", "eosio::producer_plugin", "--plugin", "eosio::chain_api_plugin", "--plugin", "eosio::http_plugin", "--http-server-address=0.0.0.0:8888", "--access-control-allow-origin=*", "--contracts-console", "--http-validate-host=false", "--verbose-http-errors", "--max-transaction-time=100"]
FROM ubuntu:18.04 AS builder

### base
RUN yes | unminimize \
Expand Down Expand Up @@ -67,16 +66,6 @@ RUN curl -LO https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.
&& cd /root \
&& rm -rf boost_1_72_0.tar.bz2 boost_1_72_0

### eosio.cdt
RUN git clone https://github.com/EOSIO/eosio.cdt.git \
&& cd eosio.cdt \
&& git checkout eosio-cdt-2.1-staging-c \
&& git submodule update --init --recursive \
&& mkdir build \
&& cd build \
&& cmake -GNinja .. \
&& ninja -j8

### eos
RUN git clone https://github.com/EOSIO/eos.git \
&& cd eos \
Expand All @@ -85,9 +74,30 @@ RUN git clone https://github.com/EOSIO/eos.git \
&& mkdir build \
&& cd build \
&& CC=clang-8 CXX=clang++-8 cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_AR=/usr/bin/llvm-ar-8 -DCMAKE_RANLIB=/usr/bin/llvm-ranlib-8 -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld .. \
&& CC=clang-8 CXX=clang++-8 ninja -j8
&& CC=clang-8 CXX=clang++-8 ninja -j5


FROM ubuntu:18.04
ENTRYPOINT ["nodeos", "--data-dir", "/root/.local/share", "-e", "-p", "eosio", "--replay-blockchain", "--plugin", "eosio::producer_plugin", "--plugin", "eosio::chain_api_plugin", "--plugin", "eosio::http_plugin", "--http-server-address=0.0.0.0:8888", "--access-control-allow-origin=*", "--contracts-console", "--http-validate-host=false", "--verbose-http-errors", "--max-transaction-time=100"]

RUN yes | unminimize \
&& apt-get update \
&& apt-get install -yq \
curl \
git \
python \
wget \
&& curl -sL https://deb.nodesource.com/setup_10.x | bash -

ENV LANG=en_US.UTF-8

WORKDIR /root/
RUN mkdir -p /root/eos/build/bin

WORKDIR /root/eos/build/bin
COPY --from=builder /root/eos/build/bin/* ./

ENV PATH="/root/eos/build/bin/:/root/eosio.cdt/build/bin/:${PATH}"
ENV PATH="/root/eos/build/bin/:${PATH}"

RUN mkdir -p "/opt/eosio/bin/contracts"

Expand Down
7 changes: 5 additions & 2 deletions .github/eosjs-ci/scripts/deploy_contracts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ sleep 1s
cleos wallet unlock --password $(cat "$CONFIG_DIR"/keys/default_wallet_password.txt) || true
create_account eosio.token $SYSTEM_ACCOUNT_PUBLIC_KEY $SYSTEM_ACCOUNT_PRIVATE_KEY
create_account returnvalue $SYSTEM_ACCOUNT_PUBLIC_KEY $SYSTEM_ACCOUNT_PRIVATE_KEY
create_account todo $SYSTEM_ACCOUNT_PUBLIC_KEY $SYSTEM_ACCOUNT_PRIVATE_KEY
create_account bob $EXAMPLE_ACCOUNT_PUBLIC_KEY $EXAMPLE_ACCOUNT_PRIVATE_KEY
create_account alice $EXAMPLE_ACCOUNT_PUBLIC_KEY $EXAMPLE_ACCOUNT_PRIVATE_KEY
create_account bobr1 $R1_EXAMPLE_ACCOUNT_PUBLIC_KEY $R1_EXAMPLE_ACCOUNT_PRIVATE_KEY
Expand Down Expand Up @@ -182,6 +183,10 @@ sleep 1s
cleos set abi cfhello $CONTRACTS_DIR/cfhello/cfhello.abi -p cfhello@active -p eosio@active
cleos set code cfhello $CONTRACTS_DIR/cfhello/cfhello.wasm -p cfhello@active -p eosio@active

sleep 1s
cleos set abi todo $CONTRACTS_DIR/kv_todo/kv_todo.abi -p todo@active -p eosio@active
cleos set code todo $CONTRACTS_DIR/kv_todo/kv_todo.wasm -p todo@active -p eosio@active

sleep 1s
cleos set abi returnvalue $CONTRACTS_DIR/action_results/action_results.abi -p returnvalue@active -p eosio@active
cleos set code returnvalue $CONTRACTS_DIR/action_results/action_results.wasm -p returnvalue@active -p eosio@active
Expand All @@ -196,8 +201,6 @@ cleos push action eosio.token transfer '["bob", "alice", "1000000.0000 SYS", "me
cleos push action eosio.token transfer '["bob", "bobr1", "1000000.0000 SYS", "memo"]' -p bob
cleos push action eosio.token transfer '["bob", "alicer1", "1000000.0000 SYS", "memo"]' -p bob

cleos push action eosio init "[]" -p eosio@active

echo "All done initializing the blockchain"

if [[ -z $NODEOS_RUNNING ]]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
git push origin ${GITHUB_REF#refs/*/}
services:
nodeos:
image: eosio/eosjs-ci:v0.2.3
image: eosio/eosjs-ci:v0.2.5

ports:
- 8888:8888
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

services:
nodeos:
image: eosio/eosjs-ci:v0.2.3
image: eosio/eosjs-ci:v0.2.5

ports:
- 8888:8888
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:

services:
nodeos:
image: eosio/eosjs-ci:v0.2.3
image: eosio/eosjs-ci:v0.2.5

ports:
- 8888:8888
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:

services:
nodeos:
image: eosio/eosjs-ci:v0.2.3
image: eosio/eosjs-ci:v0.2.5

ports:
- 8888:8888
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@
"devDependencies": {
"@blockone/eslint-config-blockone": "^3.0.0",
"@types/elliptic": "^6.4.12",
"@types/jest": "^26.0.13",
"@types/node": "^14.10.1",
"@types/jest": "^26.0.14",
"@types/node": "^14.11.2",
"@types/pako": "^1.0.1",
"cypress": "^4.12.1",
"eosjs-ecc": "^4.0.7",
"eslint": "^6.8.0",
"jest": "^26.4.2",
"jest-fetch-mock": "^3.0.3",
"ts-jest": "^26.3.0",
"ts-jest": "^26.4.1",
"ts-loader": "^7.0.5",
"typescript": "^3.9.7",
"webpack": "^4.44.1",
"webpack": "^4.44.2",
"webpack-cli": "^3.3.12"
},
"resolutions": {
Expand Down
211 changes: 0 additions & 211 deletions src/abi.abi.json

This file was deleted.

3 changes: 1 addition & 2 deletions src/eosjs-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import * as ser from './eosjs-serialize';
import { RpcError } from './eosjs-rpcerror';
import { WasmAbi } from './eosjs-wasmabi';

const abiAbi = require('../src/abi.abi.json');
const transactionAbi = require('../src/transaction.abi.json');

export class Api {
Expand Down Expand Up @@ -100,7 +99,7 @@ export class Api {
this.textEncoder = args.textEncoder;
this.textDecoder = args.textDecoder;

this.abiTypes = ser.getTypesFromAbi(ser.createInitialTypes(), abiAbi);
this.abiTypes = ser.getTypesFromAbi(ser.createAbiTypes());
this.transactionTypes = ser.getTypesFromAbi(ser.createInitialTypes(), transactionAbi);
}

Expand Down
Loading

0 comments on commit c73b44d

Please sign in to comment.